/**
 * @author Casey M. Wylie
 *
 * Defines the interface to a stack data structure.
 */

package jss2;

public interface StackADT<T>
{

    /** Adds one element to the top of the stack.
     * @param element element to be pushed on the stack.
     */
    public void push(T element);

    /** Removes and returns the top element on the stack.
     * @return T element removed from top of the stack.
     */
    public T pop();

    /** Returns without remove the top element on the stack.
     * @return T element on top of the stack.
     */
    public T peek();

    /** Returns true if the stack is empty.
     * @return boolean whether or not stack is empty.
     */
    public boolean isEmpty();

    /** Creates new array with twice the capacity.
     */
    public void expandCapacity();

    /** Returns the number of elements in the stack.
     * @return int number of elements in the stack.
     */
    public int size();

    /** Returns a string representation of the stack.
     * @return String representation of the stack.
     */
    public String toString();
}